<!DOCTYPE html>
<html>

	<head>
		<meta charset="utf-8" />
		<title>商家申请列表</title>
		<link rel="stylesheet" href="__AGENT__/css/iconfont.css" />
		<link rel="stylesheet" href="__AGENT__/css/css.css" />
		<script src="__PUBLIC__/static/layui/layui.js" type="text/javascript" charset="utf-8"></script>
	</head>

	<body>
		{include file="public/header" /}
		<div class="index_conbox">
			<div class="index_content clearfix">
				{include file="public/lefter" /}
				<div class="right">
					<!--右侧内容-->
					<div class="rigtop">
						<span class="title">商家申请列表</span>
					</div>
					<div class="indrig_con" style="position: relative;">
						<div class="zizh_conbox" style="padding-top: 20px;">
							<!--选项卡内容开始-->						
							<form id="my_form" action="{:url('oem/accounts/agentsq')}" method="post">
								<div class="zizh_con_1">
									<div class="shxx_row chax_row  clearfix">
										<div class="left">商家名称：</div>
										<div class="right clearfix">
											<input type="text" name="agent_name1" id="agent_name1" placeholder="商家名称" class="chax_input" />
										</div>
										<div class="left">手机号：</div>
										<div class="right clearfix">
											<input type="text" name="contact_tel" id="contact_tel" placeholder="手机号码" class="chax_input" />
										</div>

										<button type="submit" class="htcxbtn">查询</button>
									</div>
								</id>
							</form>							
							<div class="zizh_con_1">
									<div class="chax_conbox">
										<div class="chax_jiegnr">
											<table class="zizh_table1">
												<thead>
													<tr style="text-align: center;">
														<th class="w_20">商家名称</th>
														<th class="w_10">联系人</th>
														<th class="w_10">手机号</th>
														{if $Think.session.user_level==1}
														<th class="w_10">服务商</th>
														{/if}
														<th class="w_10">申请时间</th>
														<th class="w_10">状态</th>
														<th class="w_10">操作</th>
													</tr>
												</thead>
												<tbody id="tbody">
													{volist name="$list" id="vo" }
													<tr style="text-align: center;">
														<td>{$vo.agent_name1}</td>
														<td>{$vo.contacts}</td>
														<td>{$vo.contact_tel}</td>
														{if $Think.session.user_level==1}
														<td>{$vo.oemname}</td>
														{/if}
														<td>{$vo.add_time|substr=0,10}</td>														
														<td>
															{if $vo.state==2}
															待处理
															{else if $vo.state==1}
															已处理
															{/if}
														</td>
														<td>
															<a onclick="jiechu({$vo.id})" class="gray">驳回</a>
														</td>
													</tr>
													{/volist}
													{if $list==null||count($list)==0}<tr><td colspan="10" style="text-align: center;">无申请信息</td></tr>{/if}
												</tbody>
											</table>
											<div class="fenye" style="display: block;">
												{$list->render()}
											</div>
										</div>
									</div>
							</div>
						</div>

					</div>
				</div>
			</div>
		</div>
		{include file="public/footer" /}

	</body>

</html>
<script>
	layui.use('laydate', function() {
		var laydate = layui.laydate;

		//日期控件
		laydate.render({
			elem: '#begin_time',
			type: 'datetime',
			format: 'yyyy-MM-dd HH:mm:ss'
		});

		laydate.render({
			elem: '#end_time',
			type: 'datetime',
			format: 'yyyy-MM-dd HH:mm:ss'
		});
	})
	
	function jiechu(id){
			var con = layer.confirm('确认驳回申请?', function(index) {
			$.ajax({
				url:"{:url('accounts/agentbh')}",
				data: {
					id: id
				},
				success: function(data) {
					layer.msg(data.msg);
					layer.close(con);
					window.location.reload();
				}
			})
		});		
	}
</script>